home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10597 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  917 b 

  1. Path: newsfeed.internetmci.com!panix!usenet
  2. From: gugu@panix.com (Dae Choi)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Help with derived class of ifstream class
  5. Date: 8 Mar 1996 19:58:25 GMT
  6. Organization: PANIX Public Access Internet and Unix, NYC
  7. Message-ID: <486.6641T879T944@panix.com>
  8. References: <4hob5n$65c@daily-planet.nodak.edu>
  9. NNTP-Posting-Host: gugu.dialup.access.net
  10. X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
  11.  
  12. Hi,
  13.  
  14. >#include <iostream.h>
  15.  
  16. Perhaps you forgot to add:
  17.  
  18.  #include <iomanip.h>
  19.  
  20. >#include <fstream.h>
  21. >class X:public ifstream{
  22. >public:
  23. >   int read();
  24. >   X(char *s):ifstream(s){;};
  25. >};
  26.  
  27. >int X::read(){
  28. >   int i;
  29. >   (*this) >> i;               // this is ok
  30. >   (*this) >> hex >> i;                // compiler does not like this
  31.                ^^^
  32. >};
  33.  
  34. >The error I get is
  35. >       no match for 'operator >>(class X, enum ios::{anonymous})
  36.  
  37. Hope this helps  :^)
  38.  
  39. Dae,
  40. gugu@panix.com
  41.  
  42.